import './theme/dark.less'
import './theme/light.less'
import './App.less';
import { useEffect } from 'react';
import { useSelector } from 'react-redux'
import { RootState } from './store/store';
import Router from './router/Router'

function App() {
    const theme = useSelector((state: RootState) => state.theme.value)
    useEffect(() => {
        document.documentElement.setAttribute(
            'data-prefers-color-scheme',
            theme
        )
    }, [theme])
    return (
        <div className={theme === 'light' ? 'light-theme App' : theme === 'dark' ? 'dark-theme App' : 'App'}>
            <Router />
        </div>
    );
}

export default App;
